<template>
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column prop="date" label="Date" />
    <el-table-column prop="name" label="Name" />
    <el-table-column prop="address" label="Address" />
    <el-table-column label="操作"> 
        <el-button type="primary" size="default" @click="edit">编辑</el-button>
        <el-button  type="danger" size="default">删除</el-button>
    </el-table-column>
  </el-table>
</template>
  
  <script setup>
  import {defineEmits} from "vue"
const tableData = [
  {
    date: "2016-05-03",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-02",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-04",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
  {
    date: "2016-05-01",
    name: "Tom",
    address: "No. 189, Grove St, Los Angeles",
  },
];

//-------------定义方法--------------
//1.子传父，编辑
let emit = defineEmits("edit");
function edit() {
  emit("edit");
}
</script>
  
  <style>
</style>